package com.ios.enums;
/**
*@Author:WenTao
*@Description:文章发布状态集
*@Date:13:49 2018/7/19
*/
public enum MessageStateEnum {

    SUCCESS_PUBLISH(11,"发布成功")
    ,REVIEW_ING(00,"审核中")
    ,REVIEW_FAIL(01,"审核未通过")
    ,FAIL_PUBLISH(02,"发布失败")
    ,SUCCESS_DELECTE(12,"删除成功")
    ,FAIL_DELETE(06,"删除失败")
    ,NULL(03,"未找到对应文章")
    ,SUCCESS_SHOW(13,"展示成功")
    ,FAIL_SHOW(07,"展示失败")
    ,NULL_PARAM(04,"传入参数为空")
    ,NULL_DISABLER(05,"用户不存在");

    private int state;
    private String stateInfo;

    MessageStateEnum(int state, String stateInfo) {
        this.state = state;
        this.stateInfo = stateInfo;
    }

    /*根据传入的state返回对应的enum值*/
    public static MessageStateEnum stateof(int state){
        for (MessageStateEnum stateEnum : values()){
            if (stateEnum.getState() == state){
                return stateEnum;
            }
        }
        return null;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

}
